#include <stdio.h>

int main()
{
	double faHeight = 0;
	double moHeight = 0;
	double chHeight = 0;
	double chHeight1 = 0;
	double chHeight2 = 0;
	int sex = 0;
	int exercise = 0;
	int habit = 0;

	printf("请输入父亲身高>");
	scanf("%lf", &faHeight);
	printf("请输入母亲身高>");
	scanf("%lf", &moHeight);
	printf("请输入孩子性别（男->1/女->0）>");
	scanf("%d", &sex);
	
	if(1 == sex)
	{
		chHeight = (faHeight + moHeight) * 0.54;
		printf("您是否经常进行体育锻炼：是（1）/否（0）");
		scanf("%d", &exercise);
		if(1 == exercise)
		{
			chHeight1 = chHeight * 0.02;
		}
		printf("您是否具有良好的习惯：是（1）/否（0）");
		scanf("%d", &habit);
		if(1 == habit)
		{
			chHeight2 = chHeight * 0.015;
		}
		printf("您的身高：%.3lf cm\n",chHeight + chHeight1 + chHeight2);
	}
	else
	{
		chHeight = (faHeight * 0.923 + moHeight) / 2;
		printf("您是否经常进行体育锻炼：是（1）/否（0）");
		scanf("%d", &exercise);
		if(1 == exercise)
		{	

			chHeight1 = chHeight * 0.02;
		}
		printf("您是否具有良好的习惯：是（1）/否（0）");
		scanf("%d", &habit);
		if(1 == habit)
		{
		
			chHeight2 = chHeight * 0.015;
		}
		printf("您的身高：%.3lf cm\n", chHeight + chHeight1 + chHeight2);
	}

	return 0;
}
